/*
 * package com.fullertontech.framework.sso;
 * 
 * import java.net.MalformedURLException;
 * 
 * import org.springframework.beans.factory.annotation.Value; import
 * org.springframework.context.annotation.Bean; import
 * org.springframework.context.annotation.Configuration; import
 * org.springframework.session.data.redis.config.ConfigureRedisAction; import
 * org.springframework.util.StringUtils;
 * 
 * import com.caucho.hessian.client.HessianProxyFactory; import
 * com.fullertontech.framework.global.GlobalUtils; import com.fullertontech.framework.logger.Logger;
 * import com.smart.sso.client.ClientFilter; import com.smart.sso.client.LogoutFilter; import
 * com.smart.sso.client.PermissionFilter; import com.smart.sso.client.SmartContainer; import
 * com.smart.sso.client.SsoFilter; import com.smart.sso.rpc.AuthenticationRpcService;
 * 
 * @Configuration public class SSOConfig{
 * 
 * @Value("${sso.server.url}") private String ssoServerUrl;
 * 
 * @Value("${sso.back.url}") private String ssoBackUrl;
 * 
 * @Value("${sso.app.code}") private String ssoAppCode;
 * 
 * static { GlobalUtils.getMainClass(); } //静态资源 private String staticResources;
 * 
 * public void setStaticResources(String staticResources) { this.staticResources = staticResources;
 * }
 * 
 * @Bean(name="smartFilter") public SmartContainer productSmartContainer() {
 * Logger.info("ssoServerUrl:{},ssoBackUrl:{},ssoAppCode:{}",ssoServerUrl,ssoBackUrl,ssoAppCode);
 * SmartContainer smartContainer=new SmartContainer(); smartContainer.setSsoServerUrl(ssoServerUrl);
 * ClientFilter[] clientFilters=new ClientFilter[]
 * {productSsoFilter(),productLogoutFilter(),productPermissionFilter()};
 * smartContainer.setFilters(clientFilters); if(GlobalUtils.getMainClass()!=null) { EnableSSO
 * enableSSO=GlobalUtils.getMainClass().getAnnotation(EnableSSO.class); if(enableSSO!=null) {
 * smartContainer.setStaticResources(enableSSO.staticResources()); } }
 * if(!StringUtils.isEmpty(staticResources)) {
 * smartContainer.setStaticResources(staticResources.split(",")); } return smartContainer; }
 * 
 * public SsoFilter productSsoFilter() { SsoFilter ssoFilter=new SsoFilter();
 * ssoFilter.setSsoServerUrl(ssoServerUrl);
 * ssoFilter.setAuthenticationRpcService(productAuthenticationRpcService()); return ssoFilter; }
 * public LogoutFilter productLogoutFilter() { LogoutFilter logoutFilter=new LogoutFilter();
 * logoutFilter.setPattern("/logout"); logoutFilter.setSsoServerUrl(ssoServerUrl);
 * logoutFilter.setSsoBackUrl(ssoBackUrl);
 * logoutFilter.setAuthenticationRpcService(productAuthenticationRpcService()); return logoutFilter;
 * } public PermissionFilter productPermissionFilter() { PermissionFilter permissionFilter=new
 * PermissionFilter(); permissionFilter.setSsoAppCode(ssoAppCode);
 * permissionFilter.setSsoServerUrl(ssoServerUrl);
 * permissionFilter.setAuthenticationRpcService(productAuthenticationRpcService()); return
 * permissionFilter; }
 * 
 * public AuthenticationRpcService productAuthenticationRpcService() { try {
 * AuthenticationRpcService authenticationRpcService=(AuthenticationRpcService) new
 * HessianProxyFactory() .create(AuthenticationRpcService.class, ssoServerUrl +
 * "/rpc/authenticationRpcService"); return authenticationRpcService; } catch (MalformedURLException
 * e) { e.printStackTrace(); } return null; }
 * 
 * @Bean public ConfigureRedisAction productConfigureRedisAction() { return
 * ConfigureRedisAction.NO_OP; }
 * 
 * 
 * }
 */
